package com.xinyue.center.config;

import com.xinyue.center.dao.AccountDao;
import com.xinyue.center.dao.AccountRepository;
import com.xinyue.center.dao.redis.EnumRedisKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @Author 王广帅
 * @Date 2020/12/26 22:42
 */
@Configuration
public class CenterBeanConfig {
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private AccountRepository accountRepository;

    @Bean
    public AccountDao accountDao() {
        AccountDao accountDao = new AccountDao(redisTemplate, EnumRedisKey.Account, accountRepository);
        return accountDao;
    }
}
